package agend.client.gui.panels.agend;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JLabel;
import javax.swing.SwingConstants;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class EventPanel extends javax.swing.JPanel {
	private JLabel titleLabel;
	private JLabel fromToLabel;

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
		} catch(Exception e) {
			e.printStackTrace();
		}
	}


	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
		
	public EventPanel() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			GridBagLayout thisLayout = new GridBagLayout();
			thisLayout.rowWeights = new double[] {0.1, 0.1};
			thisLayout.rowHeights = new int[] {7, 7};
			thisLayout.columnWeights = new double[] {0.1};
			thisLayout.columnWidths = new int[] {7};
			this.setLayout(thisLayout);
			this.setPreferredSize(new java.awt.Dimension(76, 42));
			{
				titleLabel = new JLabel();
				this.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
				titleLabel.setHorizontalTextPosition(SwingConstants.CENTER);
			}
			{
				fromToLabel = new JLabel();
				this.add(fromToLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
				
				fromToLabel.setHorizontalAlignment(SwingConstants.CENTER);
				fromToLabel.setHorizontalTextPosition(SwingConstants.CENTER);
			}
			this.setBackground(Color.WHITE);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void update(String title, String fromTo)
	{
		titleLabel.setText(title);
		fromToLabel.setText(fromTo);
		updateUI();
	}

}
